<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能健身动作分析系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #1a2a6c, #2c3e50);
            color: #fff;
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
        }

        header {
            text-align: center;
            padding: 30px 0;
            margin-bottom: 30px;
            position: relative;
        }

        h1 {
            font-size: 3.2rem;
            margin-bottom: 10px;
            text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
            background: linear-gradient(to right, #00c9ff, #92fe9d);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            position: relative;
            display: inline-block;
        }

        h1::after {
            content: "";
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 120px;
            height: 4px;
            background: linear-gradient(to right, #00c9ff, #92fe9d);
            border-radius: 2px;
        }

        .subtitle {
            font-size: 1.3rem;
            opacity: 0.9;
            max-width: 800px;
            margin: 0 auto;
            line-height: 1.6;
        }

        .dashboard {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 25px;
            margin-bottom: 30px;
        }

        .panel {
            background: rgba(30, 30, 50, 0.7);
            border-radius: 20px;
            padding: 25px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
        }

        .panel-title {
            font-size: 1.8rem;
            margin-bottom: 20px;
            color: #00c9ff;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .sports-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
        }

        .sport-card {
            background: rgba(50, 70, 100, 0.6);
            border-radius: 15px;
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .sport-card:hover {
            transform: translateY(-5px);
            background: rgba(70, 100, 150, 0.7);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
            border-color: #00c9ff;
        }

        .sport-card.active {
            background: rgba(30, 150, 200, 0.7);
            border-color: #92fe9d;
        }

        .sport-icon {
            font-size: 3.5rem;
            margin-bottom: 15px;
            color: #92fe9d;
        }

        .sport-name {
            font-size: 1.4rem;
            font-weight: 600;
        }

        .animation-section {
            height: 500px;
            display: flex;
            flex-direction: column;
        }

        .animation-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .animation-container {
            flex: 1;
            background: rgba(20, 20, 40, 0.8);
            border-radius: 15px;
            position: relative;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .gym-floor {
            position: absolute;
            bottom: 0;
            width: 100%;
            height: 20%;
            background: linear-gradient(to top, #222, #111);
            border-top: 2px solid #333;
        }

        .character {
            position: relative;
            width: 180px;
            height: 350px;
            transform-style: preserve-3d;
            transform: rotateY(-10deg);
        }

        .head {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 70px;
            height: 80px;
            background: #f1c27d;
            border-radius: 50%;
            z-index: 10;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        }

        .body {
            position: absolute;
            top: 70px;
            left: 50%;
            transform: translateX(-50%);
            width: 90px;
            height: 150px;
            background: #3498db;
            border-radius: 40px 40px 10px 10px;
            z-index: 5;
        }

        .arm {
            position: absolute;
            width: 30px;
            background: #f1c27d;
            border-radius: 15px;
            transform-origin: top center;
        }

        .left-arm {
            top: 80px;
            left: 20px;
            height: 110px;
        }

        .right-arm {
            top: 80px;
            right: 20px;
            height: 110px;
        }

        .leg {
            position: absolute;
            width: 35px;
            background: #2980b9;
            border-radius: 10px 10px 5px 5px;
            transform-origin: top center;
        }

        .left-leg {
            top: 200px;
            left: 40px;
            height: 130px;
        }

        .right-leg {
            top: 200px;
            right: 40px;
            height: 130px;
        }

        .barbell {
            position: absolute;
            top: 160px;
            left: 50%;
            transform: translateX(-50%);
            width: 200px;
            height: 10px;
            background: linear-gradient(to right, #aaa, #ddd, #aaa);
            border-radius: 5px;
            z-index: 4;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
        }

        .weight {
            position: absolute;
            width: 25px;
            height: 70px;
            background: linear-gradient(to right, #555, #333, #555);
            border-radius: 5px;
        }

        .left-weight {
            left: -30px;
        }

        .right-weight {
            right: -30px;
        }

        .analysis-section {
            margin-top: 30px;
        }

        .analysis-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 25px;
        }

        .metrics {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-top: 20px;
        }

        .metric-card {
            background: rgba(40, 60, 100, 0.6);
            border-radius: 15px;
            padding: 20px;
            text-align: center;
        }

        .metric-value {
            font-size: 2.5rem;
            font-weight: 700;
            color: #92fe9d;
            margin: 10px 0;
        }

        .metric-label {
            font-size: 1.1rem;
            opacity: 0.8;
        }

        .ai-analysis {
            background: rgba(40, 60, 100, 0.6);
            border-radius: 15px;
            padding: 25px;
        }

        .ai-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
        }

        .ai-icon {
            font-size: 2.5rem;
            color: #00c9ff;
        }

        .analysis-content {
            background: rgba(30, 40, 70, 0.7);
            border-radius: 15px;
            padding: 20px;
            margin-top: 15px;
        }

        .feedback-item {
            display: flex;
            gap: 15px;
            padding: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .feedback-item:last-child {
            border-bottom: none;
        }

        .feedback-icon {
            font-size: 1.5rem;
            color: #92fe9d;
            min-width: 30px;
        }

        .feedback-good .feedback-icon {
            color: #4CAF50;
        }

        .feedback-bad .feedback-icon {
            color: #f44336;
        }

        .feedback-text {
            flex: 1;
        }

        .feedback-title {
            font-weight: 600;
            margin-bottom: 5px;
        }

        .suggestion {
            color: #92fe9d;
            font-style: italic;
            margin-top: 5px;
        }

        .controls {
            display: flex;
            gap: 15px;
            margin-top: 20px;
        }

        .btn {
            padding: 12px 25px;
            border: none;
            border-radius: 50px;
            background: linear-gradient(to right, #00c9ff, #92fe9d);
            color: #1a2a6c;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
        }

        .btn:active {
            transform: translateY(1px);
        }

        .btn-outline {
            background: transparent;
            border: 2px solid #00c9ff;
            color: #00c9ff;
        }

        @media (max-width: 1100px) {
            .dashboard {
                grid-template-columns: 1fr;
            }

            .analysis-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .sports-list {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            }

            h1 {
                font-size: 2.5rem;
            }

            .animation-container {
                height: 400px;
            }
        }
    </style>
</head>
<body>
<div class="container">
    <header>
        <h1><i class="fas fa-dumbbell"></i> 智能健身动作分析系统</h1>
        <p class="subtitle">选择运动类型，记录训练数据，获取AI驱动的动作分析和个性化改进建议</p>
    </header>

    <div class="dashboard">
        <div class="panel">
            <h2 class="panel-title"><i class="fas fa-running"></i> 运动列表</h2>
            <div class="sports-list">
                <div class="sport-card active" data-sport="squat">
                    <div class="sport-icon"><i class="fas fa-walking"></i></div>
                    <div class="sport-name">深蹲</div>
                </div>
                <div class="sport-card" data-sport="benchpress">
                    <div class="sport-icon"><i class="fas fa-dumbbell"></i></div>
                    <div class="sport-name">卧推</div>
                </div>
                <div class="sport-card" data-sport="running">
                    <div class="sport-icon"><i class="fas fa-running"></i></div>
                    <div class="sport-name">跑步</div>
                </div>
                <div class="sport-card" data-sport="deadlift">
                    <div class="sport-icon"><i class="fas fa-weight-hanging"></i></div>
                    <div class="sport-name">硬拉</div>
                </div>
                <div class="sport-card" data-sport="shoulderpress">
                    <div class="sport-icon"><i class="fas fa-hand-paper"></i></div>
                    <div class="sport-name">肩部推举</div>
                </div>
                <div class="sport-card" data-sport="rowing">
                    <div class="sport-icon"><i class="fas fa-water"></i></div>
                    <div class="sport-name">划船机</div>
                </div>
            </div>

            <div class="metrics">
                <div class="metric-card">
                    <div class="metric-label">今日运动</div>
                    <div class="metric-value">3</div>
                    <div class="metric-label">项运动</div>
                </div>
                <div class="metric-card">
                    <div class="metric-label">本周时长</div>
                    <div class="metric-value">4.2</div>
                    <div class="metric-label">小时</div>
                </div>
                <div class="metric-card">
                    <div class="metric-label">累计卡路里</div>
                    <div class="metric-value">1280</div>
                    <div class="metric-label">千卡</div>
                </div>
                <div class="metric-card">
                    <div class="metric-label">动作评分</div>
                    <div class="metric-value">86</div>
                    <div class="metric-label">分 (良好)</div>
                </div>
            </div>
        </div>

        <div class="panel animation-section">
            <div class="animation-header">
                <h2 class="panel-title"><i class="fas fa-chart-line"></i> 动作分析</h2>
                <div class="controls">
                    <button class="btn"><i class="fas fa-play"></i> 开始记录</button>
                    <button class="btn btn-outline"><i class="fas fa-sync-alt"></i> 重置</button>
                </div>
            </div>

            <div class="animation-container">
                <div class="gym-floor"></div>
                <div class="character" id="character">
                    <div class="head"></div>
                    <div class="body"></div>
                    <div class="arm left-arm"></div>
                    <div class="arm right-arm"></div>
                    <div class="leg left-leg"></div>
                    <div class="leg right-leg"></div>
                    <div class="barbell">
                        <div class="weight left-weight"></div>
                        <div class="weight right-weight"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="panel analysis-section">
        <h2 class="panel-title"><i class="fas fa-robot"></i> AI动作分析报告</h2>

        <div class="analysis-grid">
            <div class="ai-analysis">
                <div class="ai-header">
                    <i class="fas fa-brain ai-icon"></i>
                    <div>
                        <h3>深蹲动作分析</h3>
                        <p>基于您的最后一次训练数据分析</p>
                    </div>
                </div>

                <div class="analysis-content">
                    <div class="feedback-item feedback-good">
                        <div class="feedback-icon"><i class="fas fa-check-circle"></i></div>
                        <div class="feedback-text">
                            <div class="feedback-title">下蹲深度</div>
                            <div>您的下蹲深度达到了理想范围（大腿与地面平行）</div>
                        </div>
                    </div>

                    <div class="feedback-item feedback-good">
                        <div class="feedback-icon"><i class="fas fa-check-circle"></i></div>
                        <div class="feedback-text">
                            <div class="feedback-title">膝盖稳定性</div>
                            <div>膝盖位置良好，没有内扣现象</div>
                        </div>
                    </div>

                    <div class="feedback-item feedback-bad">
                        <div class="feedback-icon"><i class="fas fa-exclamation-triangle"></i></div>
                        <div class="feedback-text">
                            <div class="feedback-title">背部姿势</div>
                            <div>检测到轻微弓背现象（发生概率12%）</div>
                            <div class="suggestion">建议：保持核心收紧，胸部挺起，目视前方</div>
                        </div>
                    </div>

                    <div class="feedback-item feedback-bad">
                        <div class="feedback-icon"><i class="fas fa-exclamation-triangle"></i></div>
                        <div class="feedback-text">
                            <div class="feedback-title">重心分布</div>
                            <div>重心略微前倾（前脚掌压力过大）</div>
                            <div class="suggestion">建议：保持重心在脚后跟与脚掌中间，臀部向后坐</div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="ai-analysis">
                <div class="ai-header">
                    <i class="fas fa-chart-pie ai-icon"></i>
                    <div>
                        <h3>训练数据统计</h3>
                        <p>最近5次深蹲训练数据对比</p>
                    </div>
                </div>

                <div class="analysis-content">
                    <div class="feedback-item">
                        <div class="feedback-icon"><i class="fas fa-weight"></i></div>
                        <div class="feedback-text">
                            <div class="feedback-title">负重进步</div>
                            <div>最大负重从 80kg → 95kg (+18.7%)</div>
                        </div>
                    </div>

                    <div class="feedback-item">
                        <div class="feedback-icon"><i class="fas fa-tachometer-alt"></i></div>
                        <div class="feedback-text">
                            <div class="feedback-title">动作速度</div>
                            <div>离心阶段平均速度：0.8m/s（建议0.6-1.0m/s）</div>
                        </div>
                    </div>

                    <div class="feedback-item">
                        <div class="feedback-icon"><i class="fas fa-balance-scale"></i></div>
                        <div class="feedback-text">
                            <div class="feedback-title">平衡性</div>
                            <div>左右侧力量偏差：右腿比左腿多出力7%</div>
                            <div class="suggestion">建议：加入单腿训练纠正不平衡</div>
                        </div>
                    </div>

                    <div class="feedback-item">
                        <div class="feedback-icon"><i class="fas fa-heartbeat"></i></div>
                        <div class="feedback-text">
                            <div class="feedback-title">心率变化</div>
                            <div>平均心率：148bpm，峰值心率：172bpm</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    document.addEventListener('DOMContentLoaded', function() {
        // 运动选择功能
        const sportCards = document.querySelectorAll('.sport-card');
        const character = document.getElementById('character');
        const barbell = character.querySelector('.barbell');

        sportCards.forEach(card => {
            card.addEventListener('click', function() {
                // 移除所有active类
                sportCards.forEach(c => c.classList.remove('active'));
                // 添加active类到当前卡片
                this.classList.add('active');

                const sport = this.dataset.sport;

                // 根据选择的运动更新界面
                if(sport === 'squat') {
                    // 深蹲模式
                    barbell.style.display = 'none';
                    animateSquat();
                } else if(sport === 'benchpress') {
                    // 卧推模式
                    barbell.style.display = 'block';
                    animateBenchPress();
                }
                // 其他运动类型...
            });
        });

        // 深蹲动画
        function animateSquat() {
            const leftLeg = character.querySelector('.left-leg');
            const rightLeg = character.querySelector('.right-leg');
            const body = character.querySelector('.body');

            // 清除之前的动画
            character.style.animation = 'none';
            leftLeg.style.animation = 'none';
            rightLeg.style.animation = 'none';
            body.style.animation = 'none';

            // 添加新动画
            setTimeout(() => {
                character.style.animation = 'squatRotate 5s infinite';
                leftLeg.style.animation = 'squatLeg 5s infinite';
                rightLeg.style.animation = 'squatLeg 5s infinite';
                body.style.animation = 'squatBody 5s infinite';

                // 动态添加关键帧
                addKeyframes(`
                        @keyframes squatLeg {
                            0%, 100% { transform: rotateZ(0deg); }
                            25% { transform: rotateZ(45deg); }
                            50% { transform: rotateZ(0deg); }
                            75% { transform: rotateZ(45deg); }
                        }

                        @keyframes squatBody {
                            0%, 100% { top: 70px; }
                            25% { top: 120px; }
                            50% { top: 70px; }
                            75% { top: 120px; }
                        }

                        @keyframes squatRotate {
                            0%, 100% { transform: rotateY(-10deg) rotateX(0deg); }
                            25% { transform: rotateY(-10deg) rotateX(5deg); }
                            50% { transform: rotateY(-10deg) rotateX(0deg); }
                            75% { transform: rotateY(-10deg) rotateX(5deg); }
                        }
                    `);
            }, 10);
        }

        // 卧推动画
        function animateBenchPress() {
            const leftArm = character.querySelector('.left-arm');
            const rightArm = character.querySelector('.right-arm');
            const barbell = character.querySelector('.barbell');
            const body = character.querySelector('.body');

            // 清除之前的动画
            character.style.animation = 'none';
            leftArm.style.animation = 'none';
            rightArm.style.animation = 'none';
            barbell.style.animation = 'none';
            body.style.animation = 'none';

            // 调整身体位置
            body.style.top = '150px';

            // 添加新动画
            setTimeout(() => {
                character.style.animation = 'benchRotate 6s infinite';
                leftArm.style.animation = 'benchPress 6s infinite';
                rightArm.style.animation = 'benchPress 6s infinite';
                barbell.style.animation = 'barbellMove 6s infinite';

                // 动态添加关键帧
                addKeyframes(`
                        @keyframes benchPress {
                            0%, 100% { transform: rotateZ(30deg); }
                            35% { transform: rotateZ(75deg); }
                            65% { transform: rotateZ(30deg); }
                        }

                        @keyframes barbellMove {
                            0%, 100% { top: 160px; }
                            35% { top: 120px; }
                            65% { top: 160px; }
                        }

                        @keyframes benchRotate {
                            0%, 100% { transform: rotateY(-10deg) rotateX(0deg); }
                            35% { transform: rotateY(-10deg) rotateX(-3deg); }
                            65% { transform: rotateY(-10deg) rotateX(0deg); }
                        }
                    `);
            }, 10);
        }

        // 动态添加关键帧
        function addKeyframes(css) {
            const style = document.createElement('style');
            style.innerHTML = css;
            document.head.appendChild(style);
        }

        // 默认显示深蹲动画
        animateSquat();

        // 模拟AI分析数据更新
        setInterval(() => {
            const metrics = document.querySelectorAll('.metric-value');
            if(metrics.length > 0) {
                // 随机更新一些数据（模拟实时更新）
                const randomValue = Math.floor(Math.random() * 10) + 85;
                metrics[3].textContent = randomValue;
            }
        }, 5000);
    });
</script>
</body>
</html>